﻿namespace eLoop;

unsafe readonly struct Work<TCallback>
{
    public Work(TCallback callback1, delegate*<object, void> callback2, object state)
    {
        this.state = state;
        this.callback1 = callback1;
        this.callback2 = callback2;
    }

    public Work(TCallback callback, object state)
    {
        this.state = state;
        this.callback1 = callback;
        this.callback2 = null;
    }

    public Work(delegate*<object, void> callback, object state)
    {
        this.state = state;
        this.callback1 = default;
        this.callback2 = callback;
    }

    public readonly object state;
    public readonly TCallback callback1;
    public readonly delegate*<object, void> callback2;
}
